home *** CD-ROM | disk | FTP | other *** search
- package gratest;
-
- public class TetElements {
- public int iNumBlocs;
- public int iNumRotations;
- public int iNoRotConstraints = 1;
- public int[][] blockPositions;
- public int[][] bottomConstraints;
- public int[][] leftConstraints;
- public int[][] rightConstraints;
- public int[][] rotMove;
- public int[][] rotConstraints;
-
- public TetElements(int i, int j) {
- this.iNumBlocs = i;
- this.iNumRotations = j;
- this.blockPositions = new int[j][i];
- this.bottomConstraints = new int[j][6];
- this.leftConstraints = new int[j][6];
- this.rightConstraints = new int[j][6];
- this.rotMove = new int[j][2];
- this.rotConstraints = new int[j][];
-
- for(int k = 0; k < j; ++k) {
- this.rotMove[k][0] = -10;
- this.rotMove[k][1] = -10;
- }
-
- }
-
- public void SetPosition(int i, int j, int value) {
- this.blockPositions[i][j] = value;
- }
-
- public int GetPosition(int i, int j) {
- return this.blockPositions[i][j];
- }
-
- public void SetBottomConstraintValues(int i, int nElem, int e1, int e2, int e3, int e4, int e5) {
- this.bottomConstraints[i][0] = nElem;
- this.bottomConstraints[i][1] = e1;
- this.bottomConstraints[i][2] = e2;
- this.bottomConstraints[i][3] = e3;
- this.bottomConstraints[i][4] = e4;
- this.bottomConstraints[i][5] = e5;
- }
-
- public void SetBottomConstraintValue(int i, int j, int value) {
- this.bottomConstraints[i][j] = value;
- }
-
- public int GetBottomConstraintValue(int i, int j) {
- return this.bottomConstraints[i][j];
- }
-
- public void SetLeftConstraintValue(int i, int j, int value) {
- this.leftConstraints[i][j] = value;
- }
-
- public void SetLeftConstraintValues(int i, int nElem, int e1, int e2, int e3, int e4, int e5) {
- this.leftConstraints[i][0] = nElem;
- this.leftConstraints[i][1] = e1;
- this.leftConstraints[i][2] = e2;
- this.leftConstraints[i][3] = e3;
- this.leftConstraints[i][4] = e4;
- this.leftConstraints[i][5] = e5;
- }
-
- public int GetLeftConstraintValue(int i, int j) {
- return this.leftConstraints[i][j];
- }
-
- public void SetRightConstraintValue(int i, int j, int value) {
- this.rightConstraints[i][j] = value;
- }
-
- public void SetRightConstraintValues(int i, int nElem, int e1, int e2, int e3, int e4, int e5) {
- this.rightConstraints[i][0] = nElem;
- this.rightConstraints[i][1] = e1;
- this.rightConstraints[i][2] = e2;
- this.rightConstraints[i][3] = e3;
- this.rightConstraints[i][4] = e4;
- this.rightConstraints[i][5] = e5;
- }
-
- public int GetRightConstraintValue(int i, int j) {
- return this.rightConstraints[i][j];
- }
-
- public void SetRotMove(int i, int x, int y) {
- this.rotMove[i][0] = x;
- this.rotMove[i][1] = y;
- }
-
- public void SetRotConstraintValues(int i, int iStart, int e0, int e1, int e2, int e3, int e4, int e5) {
- this.iNoRotConstraints = 0;
- if (iStart == 0) {
- this.rotConstraints[i] = new int[(e0 + 5) / 5 * 5 + 3];
- }
-
- this.rotConstraints[i][iStart] = e0;
- this.rotConstraints[i][iStart + 1] = e1;
- this.rotConstraints[i][iStart + 2] = e2;
- this.rotConstraints[i][iStart + 3] = e3;
- this.rotConstraints[i][iStart + 4] = e4;
- this.rotConstraints[i][iStart + 5] = e5;
- }
-
- public int GetRotConstraintValue(int i, int j) {
- return this.rotConstraints[i][j];
- }
- }
-